home *** CD-ROM | disk | FTP | other *** search
/ Programmers Heaven 2 / Programmers Heaven 2.iso / files / windows / ocx / bmplst.exe / BLSAMPLE.FRM (.txt) next >
Encoding:
Visual Basic Form  |  1997-07-10  |  9.4 KB  |  306 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    BackColor       =   &H00FFFFFF&
  4.    Caption         =   "BmpLst Sample"
  5.    ClientHeight    =   4815
  6.    ClientLeft      =   1470
  7.    ClientTop       =   1785
  8.    ClientWidth     =   4695
  9.    ControlBox      =   0   'False
  10.    Height          =   5220
  11.    Left            =   1410
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   4815
  16.    ScaleWidth      =   4695
  17.    Top             =   1440
  18.    Width           =   4815
  19.    Begin TextBox Text1 
  20.       Enabled         =   0   'False
  21.       Height          =   285
  22.       Left            =   2880
  23.       TabIndex        =   11
  24.       Top             =   2280
  25.       Width           =   1575
  26.    End
  27.    Begin CommandButton Command3 
  28.       Caption         =   "Remove Item"
  29.       Enabled         =   0   'False
  30.       Height          =   375
  31.       Left            =   2880
  32.       TabIndex        =   10
  33.       Top             =   1200
  34.       Width           =   1575
  35.    End
  36.    Begin CommandButton Command2 
  37.       Caption         =   "Add Item"
  38.       Enabled         =   0   'False
  39.       Height          =   375
  40.       Left            =   2880
  41.       TabIndex        =   9
  42.       Top             =   720
  43.       Width           =   1575
  44.    End
  45.    Begin CommandButton Command1 
  46.       Caption         =   "Exit"
  47.       Height          =   375
  48.       Left            =   2880
  49.       TabIndex        =   8
  50.       Top             =   240
  51.       Width           =   1575
  52.    End
  53.    Begin Frame Frame1 
  54.       Caption         =   "Item Image"
  55.       Height          =   1815
  56.       Left            =   240
  57.       TabIndex        =   1
  58.       Top             =   2760
  59.       Width           =   2415
  60.       Begin PictureBox Picture1 
  61.          BorderStyle     =   0  'None
  62.          Height          =   495
  63.          Index           =   0
  64.          Left            =   240
  65.          Picture         =   BLSAMPLE.FRX:0000
  66.          ScaleHeight     =   495
  67.          ScaleWidth      =   495
  68.          TabIndex        =   7
  69.          Top             =   360
  70.          Width           =   495
  71.       End
  72.       Begin PictureBox Picture1 
  73.          BorderStyle     =   0  'None
  74.          Height          =   495
  75.          Index           =   1
  76.          Left            =   240
  77.          Picture         =   BLSAMPLE.FRX:0302
  78.          ScaleHeight     =   495
  79.          ScaleWidth      =   495
  80.          TabIndex        =   6
  81.          Top             =   1080
  82.          Width           =   495
  83.       End
  84.       Begin PictureBox Picture1 
  85.          BorderStyle     =   0  'None
  86.          Height          =   495
  87.          Index           =   2
  88.          Left            =   960
  89.          Picture         =   BLSAMPLE.FRX:0604
  90.          ScaleHeight     =   495
  91.          ScaleWidth      =   495
  92.          TabIndex        =   5
  93.          Top             =   360
  94.          Width           =   495
  95.       End
  96.       Begin PictureBox Picture1 
  97.          BorderStyle     =   0  'None
  98.          Height          =   495
  99.          Index           =   3
  100.          Left            =   960
  101.          Picture         =   BLSAMPLE.FRX:0906
  102.          ScaleHeight     =   495
  103.          ScaleWidth      =   495
  104.          TabIndex        =   4
  105.          Top             =   1080
  106.          Width           =   495
  107.       End
  108.       Begin PictureBox Picture1 
  109.          BorderStyle     =   0  'None
  110.          Height          =   495
  111.          Index           =   4
  112.          Left            =   1680
  113.          Picture         =   BLSAMPLE.FRX:0C08
  114.          ScaleHeight     =   495
  115.          ScaleWidth      =   495
  116.          TabIndex        =   3
  117.          Top             =   360
  118.          Width           =   495
  119.       End
  120.       Begin PictureBox Picture1 
  121.          BorderStyle     =   0  'None
  122.          Height          =   495
  123.          Index           =   5
  124.          Left            =   1680
  125.          Picture         =   BLSAMPLE.FRX:0F0A
  126.          ScaleHeight     =   495
  127.          ScaleWidth      =   495
  128.          TabIndex        =   2
  129.          Top             =   1080
  130.          Width           =   495
  131.       End
  132.       Begin Shape Shape1 
  133.          BorderStyle     =   0  'Transparent
  134.          FillColor       =   &H00FFFFFF&
  135.          FillStyle       =   0  'Solid
  136.          Height          =   735
  137.          Index           =   0
  138.          Left            =   120
  139.          Top             =   240
  140.          Width           =   735
  141.       End
  142.       Begin Shape Shape1 
  143.          BorderStyle     =   0  'Transparent
  144.          FillColor       =   &H00FFFFFF&
  145.          FillStyle       =   0  'Solid
  146.          Height          =   735
  147.          Index           =   1
  148.          Left            =   120
  149.          Top             =   960
  150.          Width           =   735
  151.       End
  152.       Begin Shape Shape1 
  153.          BorderStyle     =   0  'Transparent
  154.          FillColor       =   &H00FFFFFF&
  155.          FillStyle       =   0  'Solid
  156.          Height          =   735
  157.          Index           =   2
  158.          Left            =   840
  159.          Top             =   240
  160.          Width           =   735
  161.       End
  162.       Begin Shape Shape1 
  163.          BorderStyle     =   0  'Transparent
  164.          FillColor       =   &H00FFFFFF&
  165.          FillStyle       =   0  'Solid
  166.          Height          =   735
  167.          Index           =   3
  168.          Left            =   840
  169.          Top             =   960
  170.          Width           =   735
  171.       End
  172.       Begin Shape Shape1 
  173.          BorderStyle     =   0  'Transparent
  174.          FillColor       =   &H00FFFFFF&
  175.          FillStyle       =   0  'Solid
  176.          Height          =   735
  177.          Index           =   4
  178.          Left            =   1560
  179.          Top             =   240
  180.          Width           =   735
  181.       End
  182.       Begin Shape Shape1 
  183.          BorderStyle     =   0  'Transparent
  184.          FillColor       =   &H00FFFFFF&
  185.          FillStyle       =   0  'Solid
  186.          Height          =   735
  187.          Index           =   5
  188.          Left            =   1560
  189.          Top             =   960
  190.          Width           =   735
  191.       End
  192.    End
  193.    Begin BmpList BmpList1 
  194.       BlinkInterval   =   0
  195.       BorderEffect    =   0  'None
  196.       BorderStyle     =   1  'Fixed Single
  197.       BottomMargin    =   60
  198.       ColAlignment    =   BLSAMPLE.FRX:120C
  199.       ColDelim        =   "    "
  200.       ColWidth        =   BLSAMPLE.FRX:124E
  201.       DividerEffect   =   0  'None
  202.       Dividers        =   0  'None
  203.       FindCol         =   -1
  204.       Height          =   2415
  205.       HScroll         =   -1  'True
  206.       ItemHeight      =   600
  207.       ItemPlacement   =   0  'Top
  208.       ItemWidth       =   1800
  209.       Left            =   240
  210.       LeftMargin      =   120
  211.       MultiColumn     =   0   'False
  212.       MultiSelect     =   0  'None
  213.       NumColumns      =   0
  214.       SortCol         =   ""
  215.       Sorted          =   0   'False
  216.       SortOrder       =   0  'Ascending
  217.       TabIndex        =   0
  218.       Top             =   240
  219.       TopMargin       =   30
  220.       ValueCol        =   -1
  221.       VertGap         =   30
  222.       Width           =   2415
  223.    End
  224.    Begin Label Label1 
  225.       Caption         =   "Item Text:"
  226.       Enabled         =   0   'False
  227.       Height          =   255
  228.       Left            =   2880
  229.       TabIndex        =   12
  230.       Top             =   2040
  231.       Width           =   1215
  232.    End
  233. Dim CurIndex As Integer
  234. Sub BmpList1_Click ()
  235.     Dim I As Integer
  236.     If BmpList1.ListCount = 0 Then
  237.         Command3.Enabled = False
  238.         Exit Sub
  239.     End If
  240.     Command3.Enabled = True
  241.     If CurIndex <> -1 Then
  242.         Picture1(CurIndex).BackColor = &HFFFFFF
  243.         Shape1(CurIndex).FillColor = &HFFFFFF
  244.         CurIndex = -1
  245.     End If
  246.     For I = 0 To 5
  247.         If Picture1(I).Picture = BmpList1.Picture(BmpList1.ListIndex) Then
  248.             CurIndex = I
  249.             Picture1(CurIndex).BackColor = &HC0C0C0
  250.             Shape1(CurIndex).FillColor = &HC0C0C0
  251.             Exit For
  252.         End If
  253.     Next I
  254.     Text1.Text = BmpList1.List(BmpList1.ListIndex)
  255. End Sub
  256. Sub Command1_Click ()
  257.     End
  258. End Sub
  259. Sub Command2_Click ()
  260.     BmpList1.AddItem Text1
  261.     BmpList1.Picture(BmpList1.NewIndex) = Picture1(CurIndex).Picture
  262.     BmpList1.ScreenUpdate = True
  263.     If BmpList1.ListCount = 1 Then
  264.         BmpList1.ListIndex = 0
  265.     End If
  266. End Sub
  267. Sub Command3_Click ()
  268.     BmpList1.RemoveItem BmpList1.ListIndex
  269.     If BmpList1.ListCount = 0 Then
  270.         Command3.Enabled = False
  271.         BmpList1.ListIndex = -1
  272.     ElseIf BmpList1.ListIndex >= BmpList1.ListCount Then
  273.         BmpList1.ListIndex = BmpList1.ListCount - 1
  274.     End If
  275. End Sub
  276. Sub Form_Load ()
  277.     CurIndex = -1
  278. End Sub
  279. Sub Picture1_Click (Index As Integer)
  280.     If CurIndex <> -1 Then
  281.         Shape1(CurIndex).FillColor = &HFFFFFF
  282.         Picture1(CurIndex).BackColor = &HFFFFFF
  283.     End If
  284.     If CurIndex = Index Then
  285.         CurIndex = -1
  286.         Command2.Enabled = False
  287.         Label1.Enabled = False
  288.         Text1.Enabled = False
  289.     Else
  290.         Command2.Enabled = True
  291.         Text1.Enabled = True
  292.         Label1.Enabled = True
  293.         CurIndex = Index
  294.         Picture1(Index).BackColor = &HC0C0C0
  295.         Shape1(Index).FillColor = &HC0C0C0
  296.         If BmpList1.ListCount > 0 Then
  297.             BmpList1.Picture(BmpList1.ListIndex) = Picture1(Index).Picture
  298.         End If
  299.     End If
  300. End Sub
  301. Sub Text1_Change ()
  302.     If BmpList1.ListCount > 0 Then
  303.         BmpList1.List(BmpList1.ListIndex) = Text1.Text
  304.     End If
  305. End Sub
  306.